import { NoSkinCellRenderer } from "../../common/item/NoSkinCellRenderer";
import { ObjCreate } from "../../common/ObjCreate";
import { BaseItemNormal } from "../../common/item/BaseItemNormal";
import { DefInfo } from "../../../resource/info/DefInfo";
import { ItemData } from "../../../resource/info/ItemData";
import { LoaderHelp } from "../../../../common/display/LoaderHelp";
import { ResFileConst } from "../../../resource/ResFileConst";
import { GlobalClass } from "../../../../../com/mui/core/GlobalClass";
//class ArenaRankingRewardCell
    
    export  class ArenaRankingRewardCell extends NoSkinCellRenderer
    {
        constructor()
        {
            super();
            return;
        }

        protected /* override */ createChildren(): void
        {
            this._rankingImg = new Object /* flash.display.Bitmap */();
            ObjCreate.setObjAttri(this._rankingImg, 38, 3, -1, -1, this);
            this._rewardItem = new BaseItemNormal();
            this._rewardItem.setSize(32, 32);
            this._rewardItem.isDragAble = false;
            this._rewardItem.isDropAble = false;
            ObjCreate.setObjAttri(this._rewardItem, 40, 28, -1, -1, this);
            this._desTxt = ObjCreate.createTextField("", 33, 74, 104, 17, this);
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            this._datainfo = arg1 as DefInfo;
            this.reInit();
            return;
        }

        /* internal  */reInit(): void
        {
            var loc1=new ItemData(int(this._datainfo.text1));
            this._rewardItem.itemData = loc1;
            this._desTxt.htmlText = "<u>" + loc1.itemInfo.htmlName + "</u>";
            this._desTxt.x = 54 - int(this._desTxt.textWidth / 2);
            LoaderHelp.addResCallBack(ResFileConst.arena, this.loadFinishHander);
            return;
        }

        /* internal  */loadFinishHander(): void
        {
            this._rankingImg.bitmapData = GlobalClass.getBitmapData(this._datainfo.name);
            this._rankingImg.x = 55 - int(this._rankingImg.width / 2);
            return;
        }

        /* internal */ /* var */_datainfo: DefInfo;

        /* internal */ /* var */_desTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_rankingImg: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_rewardItem: BaseItemNormal;
    }
